/**
 * @file lv_tutorial_hello_world
 *
 */

/*
 *-------------------------------------------------------------------------------
 * Create your first object: a "Hello world" label
 * ------------------------------------------------------------------------------
 *
 * If you have ported the LittlevGL you are ready to create content on your display.
 *
 * Now you will create a "Hello world!" label and align it to the middle.
 */

/*********************
 *      INCLUDES
 *********************/
#include "lv_example_buttons_matrix.h"
#if USE_LV_TUTORIALS

/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 *  STATIC PROTOTYPES
 **********************/

/**********************
 *  STATIC VARIABLES
 **********************/

/**********************
 *      MACROS
 **********************/

/**********************
 *   GLOBAL FUNCTIONS
 **********************/

/**
 * Create 5x5 button up a button, click the button(5x5) delete it, click the bottom button create 5x5 button up it
 */

static lv_res_t btnm_action(lv_obj_t *btnm, const char *text)
{
    printf("Button:%s released\n", text);
    return LV_RES_OK;
}

void lv_example_buttons_matrix(void)
{
    static const char * btnm_map[] = { "1", "2", "3", "4", "5", "\n",
                                       "6", "7", "8", "9", "0", "\n",
                                       "\204Action1", "A", ""
                                     };

    lv_obj_t *btnm = lv_btnm_create(lv_scr_act(), NULL);
    lv_btnm_set_map(btnm, btnm_map);
    lv_btnm_set_action(btnm, btnm_action);
    lv_obj_set_size(btnm, LV_HOR_RES, LV_VER_RES/2);
}

/**********************
 *   STATIC FUNCTIONS
 **********************/

#endif /*USE_LV_TUTORIALS*/
